package com.caissa.springboot.starter.permission.autoconfigure;

import com.base.springboot.starter.permission.aspect.AuditLogAspect;
import com.base.springboot.starter.permission.service.AesTokenUtil;
import com.base.springboot.starter.permission.service.PermissionAspect;
import com.base.springboot.starter.permission.service.PermissionService;
import com.base.springboot.starter.permission.service.FeignUicRequestInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author yuzhongo
 * @date 2020/8/17 下午3:48
 */
@Configuration
public class PermissionAutoConfiguration {

    @Bean
    @ConditionalOnClass
    public PermissionAspect permissionAspect() {
        return new PermissionAspect();
    }

    @Bean
    @ConditionalOnClass
    public PermissionService permissionService() {
        return new PermissionService();
    }

    @Bean
    @ConditionalOnClass
    public FeignUicRequestInterceptor requestInterceptor() {
        return new FeignUicRequestInterceptor();
    }

    @Bean
    @ConditionalOnClass
    public AuditLogAspect auditLogAspect() {
        return new AuditLogAspect();
    }
}
